Skip to main content

Get Users List

getUsers

For the list of users you need to use getUsers and provide the pagination attributes page and perPage.

Parameters

  • page: (number) - The page number for pagination. Default: 1.
  • perPage: (number) - The number of items per page. Default: 20.

Returns

  • Promise<ResponseType<UserType[]>>: A promise that resolves with an array of UserType objects.

Example

import { getUsers } from 'react-native-altibbi';

const response = await getUsers(1, 20);
const data: UserType[] = response.data;

The getUsers will return an array of user data objects that can be decoded to a UserType array.

Responses

Status 200

Success

[
{
"id": 999999999,
"name": "Altibbi User",
"email": "[email protected]",
"phone_number": "0791234567",
"date_of_birth": "2000-01-30",
"gender": "male",
"insurance_id": "123123123",
"policy_number": "111111111",
"nationality_number": "9999999999",
"height": "180",
"weight": "90",
"blood_type": "A+",
"smoker": "yes",
"alcoholic": "no",
"marital_status": "single",
"relation_type": "brother",
"created_at": "2024-01-01 00:00:00",
"updated_at": "2024-01-01 00:00:00"
}
]

Status 401

UnauthorizedHttpException represents an Unauthorized HTTP exception with status code 401.

{
"name": "Unauthorized",
"message": "Your request was made with invalid credentials",
"code": "0",
"status": "401",
"type": "yii\\web\\UnauthorizedHttpException"
}